package cn.sylinx.horm.transaction.jdbc;

import java.sql.Connection;

import cn.sylinx.horm.util.GLog;

public enum TransactionIsolation {

    ME;

    private int transactionIsolation = Connection.TRANSACTION_READ_COMMITTED;

    private static boolean inited = false;

    public static void setTransactionIsolation(int transactionIsolation) {
        if (inited) {
            GLog.info("transaction isolation has benn setted, isolation:{}", ME.transactionIsolation);
            return;
        }

        ME.transactionIsolation = transactionIsolation;
        inited = true;
    }

    public int getTransactionIsolation() {
        return this.transactionIsolation;
    }

}
